<template>
  <div class="head">
      <el-col type="flex" align="left" :span="4">
          <div style="font-size:30px">健康监测平台</div>
      </el-col>
      <el-col :span="3" class="tip">设备总数：{{device.length}}</el-col>
      <el-col :span="3" class="tip" >在线设备：{{deviceNum}}</el-col>
      <el-col :span="3" class="tip">血糖报警总数：{{alarmGlucoseNum}}</el-col>
      <el-col :span="4" class="tip">血压报警总数：{{alarmPresureNum}}</el-col>
      <el-col :span="4" type="flex"><div style="font-size:20px">设备列表</div></el-col>
      <el-col :span="3" type="flex">
           <el-select v-model="value" placeholder="请选择">
                <el-option
                v-for="(item,index) in options"
                :key="item.deviceName"
                :label="item.deviceName"
                :value="index">
                </el-option>
            </el-select>
      </el-col>
  </div>
</template>

<script>
export default {
    props:['glucosePressureList'],
    data(){
        return{
            options: [],
            value:0,
            device:[],
            deviceNum:0,
            alarmGlucoseNum:0,
            alarmPresureNum:0,
        }
    },
    methods:{

    },
    computed:{

    },
    mounted(){
        
    },
    created(){
        this.axios.get('/glucosePresure/list').then(
            response=>{
                console.log('1',response)
                this.device=response.data
                this.options=response.data
                this.device.map((item)=>{
                    if(item.connectStatus){
                        this.deviceNum++
                    }
                    if(item.alarmGlucose){
                        this.alarmGlucoseNum++
                    }
                    if(item.alarmPresure){
                        this.alarmPresureNum++
                    }
                    
                })
            },error=>{
                console.log('2',error)
            }
        )
    }
}
</script>

<style scoped lang="less">
    .head{
        height: 60px;
        line-height: 60px;
        background: #00ffaa;
        color:#fff;
        padding: 0 20px;
    }
    .tip {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}
</style>

